<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style type="text/css">
        .search{
            width: 258px;
            height: 40px;
            background: pink;
            margin: 50px auto;
        }
        .search input{
            float: left;
            width: 208px;
            height: 40px;
            background: url("images/left.jpg") no-repeat;
            border: 0;
            padding: 0;
            outline-style: none;
            padding-left: 8px;
            color: #ccc;
        }
        .search button{
            float: left;
            width: 42px;
            height: 40px;
            background: url("images/right.jpg") no-repeat;
            border: 0;
            padding: 0;
            cursor: pointer;
        }
    </style>
    <script>
        window.onload = function(){
            var txt =  document.getElementById("txt");
            txt.onfocus = function(){
                if(txt.value == "请输入.."){
                    txt.value = "";
                    txt.style.color = "#000";
                }
            }
            txt.onblur = function(){
                if(txt.value == ""){
                    txt.value = "请输入..";
                    txt.style.color = "#ccc";
                }
            }
        }
    </script>
</head>
<body>
    <div class="search">
        <input type="text" name="" id="txt" value="请输入..">
        <button></button>
    </div>
</body>
</html>